package poker.controller;

import at.ac.tuwien.big.easyholdem.player.DerbyPlayerDAO;
import poker.guimodel.UIState;

public class MainViewController {
    
    protected UIState currentView;
    private DerbyPlayerDAO derbyPlayerDAO;

	public String login() {     
		currentView.setCurrentView(UIState.State.LOGIN);
		checkMemoryPlayerDAO();
        return "login";
	}
	
	public String register() {
		currentView.setCurrentView(UIState.State.REGISTER);
		checkMemoryPlayerDAO();
        return "register";
    }
	
	private void checkMemoryPlayerDAO()
	{
		if(derbyPlayerDAO == null)
			derbyPlayerDAO = new DerbyPlayerDAO();
	}

	public UIState getCurrentView() {
		return currentView;
	}

	public void setCurrentView(UIState currentView) {
		this.currentView = currentView;
	}

	public DerbyPlayerDAO getDerbyPlayerDAO() {
		return derbyPlayerDAO;
	}

	public void setDerbyPlayerDAO(DerbyPlayerDAO derbyPlayerDAO) {
		this.derbyPlayerDAO = derbyPlayerDAO;
	}
	

}
